export default {
    sankeyOption(opt = {}) {
        return {
            title: {
                text: opt.title
            },
            tooltip: {
                trigger: 'item',
                triggerOn: 'mousemove'
            },
            series: [
                {
                type: 'sankey',
                top: 0,
                bottom: 10,
                // left: 20,
                // right: 50,
                // nodeGap: 10,
                // nodeAlign: 'right',
                // orient: 'vertical', // 垂直展示
                draggable: false,
                // layoutIterations: 1,
                data: opt.data,
                links: opt.links,
                emphasis: {
                //   focus: 'adjacency'
                },
                label: {
                    // position: 'top',
                    // color: 'red',
                    // fontFamily: 'Arial',
                    height: 30,
                    fontSize: 10,
                    formatter: function (item) {
                        return item.data.title;
                    }
                },
                levels: [
                    {
                    depth: 0,
                    itemStyle: {
                        color: '#fbb4ae'
                    },
                    lineStyle: {
                        color: 'source',
                        opacity: 0.6
                    }
                    },
                    {
                    depth: 1,
                    itemStyle: {
                        color: '#b3cde3'
                    },
                    lineStyle: {
                        color: 'source',
                        opacity: 0.6
                    }
                    },
                    {
                    depth: 2,
                    itemStyle: {
                        color: '#ccebc5'
                    },
                    lineStyle: {
                        color: 'source',
                        opacity: 0.6
                    }
                    },
                    {
                    depth: 3,
                    itemStyle: {
                        color: '#decbe4'
                    },
                    lineStyle: {
                        color: 'source',
                        opacity: 0.6
                    }
                    }
                ],
                lineStyle: {
                    curveness: 0.5
                }
                }
            ]
        }
    }
}